<template>
	<view class="loading">
		<wyb-loading ref="loading" :title="title" :type="type" :animation="animation" :loading-type="loadingType" :mask-alpha="maskAlpha"
		 :ft-color="ftColor" :bg-color="bgColor" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				key: 0,
				wxKey: true,
				title: '请稍后',
				type: 'square',
				maskAlpha: 0.2,
				animation: 'fade',
				loadingType: 'ring',
				ftColor: '#fff',
				bgColor: '#494949'
			};
		},
		props:{
			istype:{
				type: Boolean,
				default: false,
			}
		},
		watch: {
			istype: (newVal,oldVal) =>{
				if(newVal === true) {
					this.$refs.loading.showLoading()
					console.log(newVal)
				} else {
					this.$refs.loading.hideLoading()
				}
				
			}
		}
	}
</script>

<style>

</style>
